home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Swift 3D 3D Graphic (poly/swift3D3DGraphic)
| ext
| Unsupported |
1%
| dexvert
| Boost Text serialization (other/boostTextSerialization)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| Mailbox text, 1st line "From oleg@ponder.csci.unt.edu Sun Jul 3 12:25:47 1994"
| default
| |
99%
| file
| C source, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| x-fmt/111 Plain Text File
| default
| |
100%
| gt2
| Textdatei (UNIX)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| application/mbox
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 6f 6c 65 | 67 40 70 6f 6e 64 65 72 |From ole|g@ponder|
|00000010| 2e 63 73 63 69 2e 75 6e | 74 2e 65 64 75 20 53 75 |.csci.un|t.edu Su|
|00000020| 6e 20 4a 75 6c 20 20 33 | 20 31 32 3a 32 35 3a 34 |n Jul 3| 12:25:4|
|00000030| 37 20 31 39 39 34 0a 46 | 72 6f 6d 3a 20 6f 6c 65 |7 1994.F|rom: ole|
|00000040| 67 40 70 6f 6e 64 65 72 | 2e 63 73 63 69 2e 75 6e |g@ponder|.csci.un|
|00000050| 74 2e 65 64 75 20 28 4b | 69 73 65 6c 79 6f 76 20 |t.edu (K|iselyov |
|00000060| 4f 6c 65 67 29 0a 4e 65 | 77 73 67 72 6f 75 70 73 |Oleg).Ne|wsgroups|
|00000070| 3a 20 63 6f 6d 70 2e 6c | 61 6e 67 2e 63 2b 2b 2c |: comp.l|ang.c++,|
|00000080| 63 6f 6d 70 2e 67 72 61 | 70 68 69 63 73 2c 61 6c |comp.gra|phics,al|
|00000090| 74 2e 67 72 61 70 68 69 | 63 73 2e 70 69 78 75 74 |t.graphi|cs.pixut|
|000000a0| 69 6c 73 2c 63 6f 6d 70 | 2e 73 79 73 2e 6d 61 63 |ils,comp|.sys.mac|
|000000b0| 2e 70 72 6f 67 72 61 6d | 6d 65 72 0a 53 75 62 6a |.program|mer.Subj|
|000000c0| 65 63 74 3a 20 67 72 61 | 79 69 6d 61 67 65 20 43 |ect: gra|yimage C|
|000000d0| 2b 2b 20 63 6c 61 73 73 | 6c 69 62 20 70 6f 73 74 |++ class|lib post|
|000000e0| 65 64 20 74 6f 20 63 6f | 6d 70 2e 73 6f 75 72 63 |ed to co|mp.sourc|
|000000f0| 65 73 2e 6d 69 73 63 0a | 44 61 74 65 3a 20 33 30 |es.misc.|Date: 30|
|00000100| 20 4a 75 6e 20 31 39 39 | 34 20 31 35 3a 31 39 3a | Jun 199|4 15:19:|
|00000110| 34 35 20 2d 30 35 30 30 | 0a 4f 72 67 61 6e 69 7a |45 -0500|.Organiz|
|00000120| 61 74 69 6f 6e 3a 20 55 | 6e 69 76 65 72 73 69 74 |ation: U|niversit|
|00000130| 79 20 6f 66 20 4e 6f 72 | 74 68 20 54 65 78 61 73 |y of Nor|th Texas|
|00000140| 0a 52 65 70 6c 79 2d 54 | 6f 3a 20 6f 6c 65 67 40 |.Reply-T|o: oleg@|
|00000150| 70 6f 6e 64 65 72 2e 63 | 73 63 69 2e 75 6e 74 2e |ponder.c|sci.unt.|
|00000160| 65 64 75 0a 4e 4e 54 50 | 2d 50 6f 73 74 69 6e 67 |edu.NNTP|-Posting|
|00000170| 2d 48 6f 73 74 3a 20 73 | 70 61 72 6b 79 2e 73 74 |-Host: s|parky.st|
|00000180| 65 72 6c 69 6e 67 2e 63 | 6f 6d 0a 53 75 6d 6d 61 |erling.c|om.Summa|
|00000190| 72 79 3a 20 67 72 61 79 | 73 63 61 6c 65 20 69 6d |ry: gray|scale im|
|000001a0| 61 67 65 20 70 72 6f 63 | 65 73 73 69 6e 67 20 63 |age proc|essing c|
|000001b0| 6c 61 73 73 20 6c 69 62 | 72 61 72 79 20 61 6e 64 |lass lib|rary and|
|000001c0| 20 76 65 72 69 66 69 63 | 61 74 69 6f 6e 20 63 6f | verific|ation co|
|000001d0| 64 65 0a 4b 65 79 77 6f | 72 64 73 3a 20 67 72 61 |de.Keywo|rds: gra|
|000001e0| 79 73 63 61 6c 65 2c 20 | 69 6d 61 67 65 20 70 72 |yscale, |image pr|
|000001f0| 6f 63 65 73 73 69 6e 67 | 2c 20 43 2b 2b 2c 20 63 |ocessing|, C++, c|
|00000200| 6c 61 73 73 20 6c 69 62 | 72 61 72 79 0a 45 6e 76 |lass lib|rary.Env|
|00000210| 69 72 6f 6e 6d 65 6e 74 | 3a 20 43 2b 2b 2c 20 74 |ironment|: C++, t|
|00000220| 65 73 74 65 64 5f 6f 6e | 7b 47 2b 2b 20 32 2e 32 |ested_on|{G++ 2.2|
|00000230| 2e 32 2b 2c 20 53 79 6d | 61 6e 74 65 63 20 36 2e |.2+, Sym|antec 6.|
|00000240| 30 2e 31 2b 2c 20 53 75 | 6e 2c 20 48 50 2c 20 4d |0.1+, Su|n, HP, M|
|00000250| 61 63 2c 20 53 65 71 75 | 65 6e 74 7d 0a 0a 54 68 |ac, Sequ|ent}..Th|
|00000260| 69 73 20 70 61 63 6b 61 | 67 65 20 68 61 73 20 6a |is packa|ge has j|
|00000270| 75 73 74 20 62 65 65 6e | 20 70 6f 73 74 65 64 20 |ust been| posted |
|00000280| 74 6f 20 63 6f 6d 70 2e | 73 6f 75 72 63 65 73 2e |to comp.|sources.|
|00000290| 6d 69 73 63 2e 0a 0a 09 | 67 72 61 79 69 6d 61 67 |misc....|grayimag|
|000002a0| 65 5f 63 6c 61 73 73 6c | 69 62 20 69 73 20 61 20 |e_classl|ib is a |
|000002b0| 43 2b 2b 20 63 6c 61 73 | 73 20 6c 69 62 72 61 72 |C++ clas|s librar|
|000002c0| 79 20 74 6f 20 64 6f 20 | 61 20 67 65 6e 65 72 69 |y to do |a generi|
|000002d0| 63 0a 70 72 6f 63 65 73 | 73 69 6e 67 20 6f 66 20 |c.proces|sing of |
|000002e0| 67 72 61 79 73 63 61 6c | 65 20 69 6d 61 67 65 73 |grayscal|e images|
|000002f0| 2e 20 20 49 74 20 69 73 | 20 6f 6e 65 20 70 61 72 |. It is| one par|
|00000300| 74 20 6f 66 20 6d 79 20 | 69 6d 61 67 65 0a 63 6f |t of my |image.co|
|00000310| 6d 70 72 65 73 73 69 6f | 6e 20 63 6f 64 65 20 49 |mpressio|n code I|
|00000320| 27 76 65 20 62 65 65 6e | 20 6d 65 73 73 69 6e 67 |'ve been| messing|
|00000330| 20 77 69 74 68 20 66 6f | 72 20 61 6c 6d 6f 73 74 | with fo|r almost|
|00000340| 20 33 20 79 65 61 72 73 | 2e 20 54 68 69 73 20 70 | 3 years|. This p|
|00000350| 61 72 74 0a 69 73 20 67 | 65 6e 65 72 61 6c 20 65 |art.is g|eneral e|
|00000360| 6e 6f 75 67 68 20 74 6f | 20 62 65 20 6f 66 20 73 |nough to| be of s|
|00000370| 6f 6d 65 20 69 6e 74 65 | 72 65 73 74 20 74 6f 20 |ome inte|rest to |
|00000380| 66 6f 6c 6b 73 20 61 74 | 20 6c 61 72 67 65 20 28 |folks at| large (|
|00000390| 49 0a 68 6f 70 65 29 2e | 20 49 74 20 6c 65 74 73 |I.hope).| It lets|
|000003a0| 20 79 6f 75 20 64 6f 20 | 61 20 76 61 72 69 65 74 | you do |a variet|
|000003b0| 79 20 6f 66 20 64 69 66 | 66 65 72 65 6e 74 20 6f |y of dif|ferent o|
|000003c0| 70 65 72 61 74 69 6f 6e | 73 20 6f 6e 20 69 6d 61 |peration|s on ima|
|000003d0| 67 65 73 2c 0a 72 65 63 | 74 61 6e 67 75 6c 61 72 |ges,.rec|tangular|
|000003e0| 20 61 72 65 61 73 2c 20 | 65 74 63 3a 20 73 61 79 | areas, |etc: say|
|000003f0| 2c 20 61 64 64 20 74 77 | 6f 20 69 6d 61 67 65 73 |, add tw|o images|
|00000400| 2c 20 63 6f 6d 70 75 74 | 65 20 74 68 65 69 72 20 |, comput|e their |
|00000410| 22 73 63 61 6c 61 72 0a | 70 72 6f 64 75 63 74 22 |"scalar.|product"|
|00000420| 2c 20 6d 6f 64 69 66 79 | 20 70 69 78 65 6c 20 76 |, modify| pixel v|
|00000430| 61 6c 75 65 73 20 6f 76 | 65 72 20 74 68 65 20 65 |alues ov|er the e|
|00000440| 6e 74 69 72 65 20 69 6d | 61 67 65 20 6f 72 20 73 |ntire im|age or s|
|00000450| 6f 6d 65 0a 72 65 63 74 | 61 6e 67 75 6c 61 72 20 |ome.rect|angular |
|00000460| 61 72 65 61 20 6f 66 20 | 69 74 20 69 6e 20 61 20 |area of |it in a |
|00000470| 5f 76 61 72 69 65 74 79 | 5f 20 6f 66 20 77 61 79 |_variety|_ of way|
|00000480| 73 2c 20 65 71 75 61 6c | 69 7a 65 20 74 68 65 20 |s, equal|ize the |
|00000490| 69 6d 61 67 65 0a 68 69 | 73 74 6f 67 72 61 6d 2c |image.hi|stogram,|
|000004a0| 20 73 74 75 66 66 20 6c | 69 6b 65 20 74 68 61 74 | stuff l|ike that|
|000004b0| 2e 20 20 4f 6e 65 20 66 | 75 6e 63 74 69 6f 6e 2c |. One f|unction,|
|000004c0| 20 73 68 69 66 74 5f 63 | 6c 69 70 5f 61 64 64 28 | shift_c|lip_add(|
|000004d0| 29 2c 20 64 6f 65 73 0a | 61 63 74 75 61 6c 6c 79 |), does.|actually|
|000004e0| 20 74 68 65 20 66 69 6c | 74 72 61 74 69 6f 6e 20 | the fil|tration |
|000004f0| 28 63 6f 6e 76 6f 6c 75 | 74 69 6f 6e 29 2e 20 4d |(convolu|tion). M|
|00000500| 6f 72 70 68 6f 6c 6f 67 | 69 63 61 6c 20 66 69 6c |orpholog|ical fil|
|00000510| 74 72 61 74 69 6f 6e 20 | 69 73 0a 69 6d 70 6c 65 |tration |is.imple|
|00000520| 6d 65 6e 74 65 64 20 61 | 73 20 77 65 6c 6c 2e 20 |mented a|s well. |
|00000530| 49 20 74 72 69 65 64 20 | 74 6f 20 6d 61 6b 65 20 |I tried |to make |
|00000540| 74 68 65 20 63 6f 64 65 | 20 61 73 20 6f 70 74 69 |the code| as opti|
|00000550| 6d 61 6c 20 61 73 20 49 | 20 63 6f 75 6c 64 0a 74 |mal as I| could.t|
|00000560| 68 69 6e 6b 20 6f 66 20 | 28 77 69 74 68 6f 75 74 |hink of |(without|
|00000570| 20 67 65 74 74 69 6e 67 | 20 69 6e 74 6f 20 61 73 | getting| into as|
|00000580| 73 65 6d 62 6c 79 20 2d | 3a 29 2e 20 54 68 65 20 |sembly -|:). The |
|00000590| 70 61 63 6b 61 67 65 20 | 63 61 6e 0a 72 65 61 64 |package |can.read|
|000005a0| 2f 77 72 69 74 65 20 58 | 57 44 2c 20 47 72 6f 75 |/write X|WD, Grou|
|000005b0| 70 20 47 20 54 49 46 46 | 20 61 6e 64 20 50 47 4d |p G TIFF| and PGM|
|000005c0| 20 66 69 6c 65 20 66 6f | 72 6d 61 74 73 3b 20 61 | file fo|rmats; a|
|000005d0| 63 74 75 61 6c 6c 79 2c | 20 74 68 65 0a 70 61 63 |ctually,| the.pac|
|000005e0| 6b 61 67 65 20 75 6e 64 | 65 72 73 74 61 6e 64 73 |kage und|erstands|
|000005f0| 20 77 68 69 63 68 20 66 | 69 6c 65 20 66 6f 72 6d | which f|ile form|
|00000600| 61 74 20 69 74 27 73 20 | 61 73 6b 65 64 20 74 6f |at it's |asked to|
|00000610| 20 72 65 61 64 20 61 6e | 64 20 73 65 6c 65 63 74 | read an|d select|
|00000620| 73 0a 74 68 65 20 61 70 | 70 72 6f 70 72 69 61 74 |s.the ap|propriat|
|00000630| 65 20 6d 65 74 68 6f 64 | 20 61 75 74 6f 6d 61 74 |e method| automat|
|00000640| 69 63 61 6c 6c 79 2e 20 | 20 49 20 64 65 6d 6f 6e |ically. | I demon|
|00000650| 73 74 72 61 74 65 64 20 | 70 69 65 63 65 73 20 61 |strated |pieces a|
|00000660| 74 20 44 61 74 61 0a 43 | 6f 6d 70 72 65 73 73 69 |t Data.C|ompressi|
|00000670| 6f 6e 20 43 6f 6e 66 65 | 72 65 6e 63 65 73 2c 20 |on Confe|rences, |
|00000680| 61 6e 64 20 73 6f 6d 65 | 20 70 65 6f 70 6c 65 20 |and some| people |
|00000690| 73 75 67 67 65 73 74 65 | 64 20 6d 65 20 73 75 62 |suggeste|d me sub|
|000006a0| 6d 69 74 20 69 74 20 69 | 6e 74 6f 0a 74 68 65 20 |mit it i|nto.the |
|000006b0| 70 75 62 6c 69 63 20 64 | 6f 6d 61 69 6e 2e 0a 0a |public d|omain...|
|000006c0| 09 54 68 65 20 66 69 6c | 65 20 69 6d 61 67 65 73 |.The fil|e images|
|000006d0| 2e 64 72 20 74 65 6c 6c | 73 20 65 78 61 63 74 6c |.dr tell|s exactl|
|000006e0| 79 20 77 68 69 63 68 20 | 6d 6f 64 75 6c 65 73 20 |y which |modules |
|000006f0| 61 72 65 20 69 6e 20 74 | 68 65 0a 70 61 63 6b 61 |are in t|he.packa|
|00000700| 67 65 20 61 6e 64 20 77 | 68 61 74 20 74 68 65 79 |ge and w|hat they|
|00000710| 20 61 72 65 20 67 6f 6f | 64 20 66 6f 72 2e 20 54 | are goo|d for. T|
|00000720| 68 65 72 65 20 61 72 65 | 20 73 65 76 65 72 61 6c |here are| several|
|00000730| 20 76 2a 2e 63 63 20 66 | 69 6c 65 73 20 69 6e 0a | v*.cc f|iles in.|
|00000740| 74 68 65 20 70 61 63 6b | 61 67 65 3a 20 74 68 65 |the pack|age: the|
|00000750| 73 65 20 61 72 65 20 76 | 65 72 69 66 69 63 61 74 |se are v|erificat|
|00000760| 69 6f 6e 20 66 69 6c 65 | 73 2c 20 79 6f 75 20 63 |ion file|s, you c|
|00000770| 61 6e 20 63 6f 6d 70 69 | 6c 65 20 74 68 65 6d 20 |an compi|le them |
|00000780| 61 6e 64 0a 72 75 6e 20 | 74 6f 20 6d 61 6b 65 20 |and.run |to make |
|00000790| 73 75 72 65 20 65 76 65 | 72 79 74 68 69 6e 67 20 |sure eve|rything |
|000007a0| 77 6f 72 6b 73 20 61 73 | 20 69 74 27 73 20 73 75 |works as| it's su|
|000007b0| 70 70 6f 73 65 64 20 74 | 6f 2e 20 20 54 68 65 20 |pposed t|o. The |
|000007c0| 76 61 6c 69 64 61 74 69 | 6f 6e 0a 66 69 6c 65 73 |validati|on.files|
|000007d0| 20 63 61 6e 20 61 6c 73 | 6f 20 62 65 20 75 73 65 | can als|o be use|
|000007e0| 64 20 61 73 20 61 6e 20 | 65 78 61 6d 70 6c 65 20 |d as an |example |
|000007f0| 61 73 20 74 6f 20 68 6f | 77 20 74 6f 20 75 73 65 |as to ho|w to use|
|00000800| 20 74 68 65 20 70 61 63 | 6b 61 67 65 0a 28 62 65 | the pac|kage.(be|
|00000810| 63 61 75 73 65 20 74 68 | 65 79 20 74 65 73 74 2c |cause th|ey test,|
|00000820| 20 74 68 61 74 20 69 73 | 2c 20 75 73 65 20 61 6c | that is|, use al|
|00000830| 6c 20 74 68 65 20 63 6f | 6e 73 74 72 75 63 74 69 |l the co|nstructi|
|00000840| 6f 6e 73 2f 63 6c 61 73 | 73 65 73 0a 2f 66 75 6e |ons/clas|ses./fun|
|00000850| 63 74 69 6f 6e 73 20 2f | 6d 65 74 68 6f 64 73 20 |ctions /|methods |
|00000860| 6f 66 20 74 68 65 20 70 | 61 63 6b 61 67 65 2c 20 |of the p|ackage, |
|00000870| 61 6e 64 20 6e 6f 74 20 | 6f 6e 63 65 20 38 3a 29 |and not |once 8:)|
|00000880| 0a 0a 09 54 68 65 20 70 | 61 63 6b 61 67 65 20 68 |...The p|ackage h|
|00000890| 61 73 20 62 65 65 6e 20 | 63 6f 6d 70 69 6c 65 64 |as been |compiled|
|000008a0| 20 77 69 74 68 20 67 63 | 63 2f 67 2b 2b 20 76 65 | with gc|c/g++ ve|
|000008b0| 72 73 69 6f 6e 20 32 2e | 32 2e 32 20 61 6e 64 0a |rsion 2.|2.2 and.|
|000008c0| 6c 61 74 65 72 20 6f 6e | 20 53 75 6e 20 53 70 61 |later on| Sun Spa|
|000008d0| 72 63 2f 53 75 6e 4f 53 | 2c 20 48 50 20 39 30 30 |rc/SunOS|, HP 900|
|000008e0| 30 2c 20 53 65 71 75 65 | 6e 74 20 53 79 6d 6d 65 |0, Seque|nt Symme|
|000008f0| 74 72 79 2f 44 79 6e 69 | 78 2c 0a 43 6f 6e 63 75 |try/Dyni|x,.Concu|
|00000900| 72 72 65 6e 74 2f 52 54 | 55 2c 20 61 6e 64 20 77 |rrent/RT|U, and w|
|00000910| 69 74 68 20 53 79 6d 61 | 6e 74 65 63 20 43 2b 2b |ith Syma|ntec C++|
|00000920| 20 36 2e 30 2e 31 20 28 | 74 68 72 6f 75 67 68 20 | 6.0.1 (|through |
|00000930| 37 2e 30 2e 32 29 20 6f | 6e 20 4d 61 63 2e 0a 54 |7.0.2) o|n Mac..T|
|00000940| 68 65 20 70 61 63 6b 61 | 67 65 20 68 61 73 20 62 |he packa|ge has b|
|00000950| 65 65 6e 20 69 6e 20 6f | 70 65 72 61 74 69 6f 6e |een in o|peration|
|00000960| 20 66 6f 72 20 32 2e 35 | 20 79 65 61 72 73 2e 0a | for 2.5| years..|
|00000970| 0a 09 49 20 61 6c 73 6f | 20 68 61 76 65 20 74 6f |..I also| have to|
|00000980| 20 6d 65 6e 74 69 6f 6e | 20 74 68 61 74 20 74 68 | mention| that th|
|00000990| 65 20 69 6d 61 67 65 20 | 70 61 63 6b 61 67 65 20 |e image |package |
|000009a0| 49 27 6d 20 73 75 62 6d | 69 74 74 69 6e 67 0a 69 |I'm subm|itting.i|
|000009b0| 73 20 6a 75 73 74 20 74 | 68 65 20 76 65 72 79 20 |s just t|he very |
|000009c0| 62 6f 74 74 6f 6d 20 6c | 61 79 65 72 20 6f 66 20 |bottom l|ayer of |
|000009d0| 74 68 65 20 69 6d 61 67 | 65 20 61 6e 64 20 76 69 |the imag|e and vi|
|000009e0| 64 65 6f 20 70 72 6f 63 | 65 73 73 69 6e 67 20 73 |deo proc|essing s|
|000009f0| 74 75 66 66 0a 49 27 76 | 65 20 62 65 65 6e 20 77 |tuff.I'v|e been w|
|00000a00| 6f 72 6b 69 6e 67 20 6f | 6e 2e 20 54 68 65 20 62 |orking o|n. The b|
|00000a10| 6f 74 74 6f 6d 20 6c 61 | 79 65 72 20 69 73 20 6d |ottom la|yer is m|
|00000a20| 65 61 6e 74 20 74 6f 20 | 67 69 76 65 20 74 68 65 |eant to |give the|
|00000a30| 20 62 61 73 69 63 0a 77 | 6f 72 6b 69 6e 67 20 65 | basic.w|orking e|
|00000a40| 6e 76 69 72 6f 6e 6d 65 | 6e 74 20 72 61 74 68 65 |nvironme|nt rathe|
|00000a50| 72 20 74 6f 20 64 6f 20 | 73 6f 6d 65 74 68 69 6e |r to do |somethin|
|00000a60| 67 20 66 61 6e 63 79 20 | 77 69 74 68 20 74 68 65 |g fancy |with the|
|00000a70| 20 69 6d 61 67 65 0a 28 | 74 68 6f 75 67 68 2c 20 | image.(|though, |
|00000a80| 42 54 57 2c 20 66 75 6e | 63 74 69 6f 6e 20 73 68 |BTW, fun|ction sh|
|00000a90| 69 66 74 5f 63 6c 69 70 | 5f 61 64 64 28 29 20 6d |ift_clip|_add() m|
|00000aa0| 61 6b 65 73 20 74 68 65 | 20 63 6f 6e 76 6f 6c 75 |akes the| convolu|
|00000ab0| 74 69 6f 6e 20 69 6e 20 | 74 77 6f 0a 73 74 6d 74 |tion in |two.stmt|
|00000ac0| 73 3b 20 61 6e 64 20 74 | 68 69 73 20 6c 65 74 73 |s; and t|his lets|
|00000ad0| 20 79 6f 75 20 64 6f 20 | 61 20 77 68 6f 6c 65 20 | you do |a whole |
|00000ae0| 6c 6f 74 20 6f 66 20 74 | 68 65 20 66 61 6e 63 79 |lot of t|he fancy|
|00000af0| 20 74 68 69 6e 67 73 20 | 69 6e 20 74 68 65 0a 64 | things |in the.d|
|00000b00| 69 67 69 74 61 6c 20 64 | 61 72 6b 72 6f 6f 6d 29 |igital d|arkroom)|
|00000b10| 2e 20 53 6f 2c 20 74 68 | 65 72 65 20 69 73 20 6d |. So, th|ere is m|
|00000b20| 75 63 68 20 6d 6f 72 65 | 20 74 6f 20 74 68 65 20 |uch more| to the |
|00000b30| 73 74 6f 72 79 2e 20 42 | 54 57 2c 20 69 74 20 61 |story. B|TW, it a|
|00000b40| 6c 73 6f 0a 6d 65 61 6e | 73 20 74 68 61 74 20 49 |lso.mean|s that I|
|00000b50| 27 6d 20 63 6f 6e 73 74 | 61 6e 74 6c 79 20 61 64 |'m const|antly ad|
|00000b60| 64 69 6e 67 20 74 6f 20 | 74 68 65 20 70 61 63 6b |ding to |the pack|
|00000b70| 61 67 65 20 28 61 73 20 | 49 20 63 6f 6d 65 20 61 |age (as |I come a|
|00000b80| 63 72 6f 73 73 20 61 0a | 6e 65 65 64 20 66 6f 72 |cross a.|need for|
|00000b90| 20 73 6f 6d 65 20 66 75 | 6e 63 74 69 6f 6e 2c 20 | some fu|nction, |
|00000ba0| 6f 70 74 69 6f 6e 2c 20 | 65 74 63 29 2c 20 73 6f |option, |etc), so|
|00000bb0| 20 79 6f 75 72 20 63 6f | 6d 6d 65 6e 74 73 2f 73 | your co|mments/s|
|00000bc0| 75 67 67 65 73 74 69 6f | 6e 73 0a 77 69 6c 6c 20 |uggestio|ns.will |
|00000bd0| 62 65 20 68 69 67 68 6c | 79 20 61 70 70 72 65 63 |be highl|y apprec|
|00000be0| 69 61 74 65 64 2e 0a 0a | 09 41 6e 64 20 6e 6f 77 |iated...|.And now|
|00000bf0| 2c 20 68 65 72 65 27 73 | 20 61 20 71 75 69 63 6b |, here's| a quick|
|00000c00| 20 67 6c 61 6e 63 65 20 | 61 74 20 74 68 65 20 70 | glance |at the p|
|00000c10| 61 63 6b 61 67 65 20 63 | 61 70 61 62 69 6c 69 74 |ackage c|apabilit|
|00000c20| 69 65 73 3a 0a 0a 2f 2f | 20 4e 6f 74 65 21 20 54 |ies:..//| Note! T|
|00000c30| 68 69 73 20 69 73 20 74 | 68 65 20 2a 63 6f 72 72 |his is t|he *corr|
|00000c40| 65 63 74 2a 20 63 6f 64 | 65 3b 20 50 75 74 20 69 |ect* cod|e; Put i|
|00000c50| 74 20 77 69 74 68 69 6e | 20 6d 61 69 6e 28 29 7b |t within| main(){|
|00000c60| 7d 2c 20 61 6e 64 20 69 | 74 20 77 69 6c 6c 0a 2f |}, and i|t will./|
|00000c70| 2f 20 63 6f 6d 70 69 6c | 65 2c 20 72 75 6e 20 61 |/ compil|e, run a|
|00000c80| 6e 64 20 66 69 6e 69 73 | 68 20 77 69 74 68 6f 75 |nd finis|h withou|
|00000c90| 74 20 65 72 72 6f 72 73 | 0a 0a 2f 2f 20 50 69 78 |t errors|..// Pix|
|00000ca0| 65 6c 20 6f 70 65 72 61 | 74 69 6f 6e 73 0a 0a 49 |el opera|tions..I|
|00000cb0| 4d 41 47 45 20 69 6d 31 | 28 32 35 36 2c 32 35 36 |MAGE im1|(256,256|
|00000cc0| 2c 38 29 3b 20 49 4d 41 | 47 45 20 69 6d 32 28 69 |,8); IMA|GE im2(i|
|00000cd0| 6d 31 29 3b 0a 69 6d 31 | 20 3d 20 31 3b 20 69 6d |m1);.im1| = 1; im|
|00000ce0| 32 20 3d 20 69 6d 31 3b | 20 69 6d 31 20 2a 3d 20 |2 = im1;| im1 *= |
|00000cf0| 34 3b 09 09 2f 2f 20 41 | 73 73 69 67 6e 69 6e 67 |4;..// A|ssigning|
|00000d00| 20 61 20 76 61 6c 75 65 | 20 74 6f 20 65 76 65 72 | a value| to ever|
|00000d10| 79 20 70 69 78 65 6c 0a | 61 73 73 65 72 74 28 20 |y pixel.|assert( |
|00000d20| 69 6d 31 20 3d 3d 20 34 | 20 29 3b 20 61 73 73 65 |im1 == 4| ); asse|
|00000d30| 72 74 28 20 69 6d 31 20 | 3e 30 20 29 3b 09 2f 2f |rt( im1 |>0 );.//|
|00000d40| 20 43 68 65 63 6b 69 6e | 67 20 75 70 20 74 68 65 | Checkin|g up the|
|00000d50| 20 76 61 6c 75 65 20 6f | 66 20 65 76 65 72 79 20 | value o|f every |
|00000d60| 70 69 78 65 6c 0a 69 6d | 31 2e 69 6e 76 65 72 74 |pixel.im|1.invert|
|00000d70| 28 29 3b 20 69 6d 31 2e | 63 6c 65 61 72 28 29 3b |(); im1.|clear();|
|00000d80| 20 69 6d 32 20 3c 3c 3d | 20 32 3b 20 69 6d 31 20 | im2 <<=| 2; im1 |
|00000d90| 3d 20 35 3b 20 0a 69 6d | 31 20 26 3d 20 30 78 66 |= 5; .im|1 &= 0xf|
|00000da0| 65 3b 20 20 61 73 73 65 | 72 74 28 20 69 6d 31 3d |e; asse|rt( im1=|
|00000db0| 3d 69 6d 32 29 3b 09 2f | 2f 20 4d 6f 64 69 66 79 |=im2);./|/ Modify|
|00000dc0| 69 6e 67 20 65 76 65 72 | 79 20 70 69 78 65 6c 0a |ing ever|y pixel.|
|00000dd0| 69 6d 31 2e 63 6c 65 61 | 72 28 29 3b 20 69 6d 31 |im1.clea|r(); im1|
|00000de0| 20 2d 3d 20 69 6d 32 3b | 20 69 6d 32 20 3d 20 69 | -= im2;| im2 = i|
|00000df0| 6d 31 3b 20 09 2f 2f 20 | 53 75 62 74 72 61 63 74 |m1; .// |Subtract|
|00000e00| 69 6e 67 20 74 77 6f 20 | 69 6d 61 67 65 73 0a 09 |ing two |images..|
|00000e10| 09 09 09 09 2f 2f 20 41 | 70 70 6c 79 69 6e 67 20 |....// A|pplying |
|00000e20| 2a 61 6e 79 2a 20 66 75 | 6e 63 74 69 6f 6e 20 74 |*any* fu|nction t|
|00000e30| 6f 20 65 76 65 72 79 0a | 69 6d 31 2e 61 62 73 28 |o every.|im1.abs(|
|00000e40| 29 3b 20 69 6d 32 2e 61 | 70 70 6c 79 28 3a 3a 61 |); im2.a|pply(::a|
|00000e50| 62 73 29 3b 20 61 73 73 | 65 72 74 28 69 6d 31 20 |bs); ass|ert(im1 |
|00000e60| 3d 3d 20 69 6d 32 29 3b | 20 2f 2f 20 70 69 78 65 |== im2);| // pixe|
|00000e70| 6c 20 28 61 62 73 28 29 | 20 69 6e 20 74 68 65 20 |l (abs()| in the |
|00000e80| 65 78 2e 29 0a 61 73 73 | 65 72 74 28 20 69 6d 31 |ex.).ass|ert( im1|
|00000e90| 20 2a 20 69 6d 31 20 3d | 3d 20 6e 6f 72 6d 5f 32 | * im1 =|= norm_2|
|00000ea0| 5f 73 71 72 28 69 6d 31 | 29 20 29 3b 09 2f 2f 20 |_sqr(im1|) );.// |
|00000eb0| 43 6f 6d 70 75 74 69 6e | 67 20 74 68 65 20 22 73 |Computin|g the "s|
|00000ec0| 63 61 6c 61 72 20 70 72 | 6f 64 75 63 74 22 0a 09 |calar pr|oduct"..|
|00000ed0| 09 09 09 09 2f 2f 20 61 | 6e 64 20 69 6d 61 67 65 |....// a|nd image|
|00000ee0| 20 6e 6f 72 6d 0a 0a 2f | 2f 20 53 71 75 61 72 65 | norm../|/ Square|
|00000ef0| 20 61 6e 64 20 72 65 63 | 74 61 6e 67 75 6c 61 72 | and rec|tangular|
|00000f00| 20 70 61 72 74 73 20 6f | 66 20 69 6d 61 67 65 0a | parts o|f image.|
|00000f10| 0a 69 6d 31 20 3d 20 32 | 2a 70 61 74 74 65 72 6e |.im1 = 2|*pattern|
|00000f20| 3b 20 69 6d 32 20 3d 20 | 70 61 74 74 65 72 6e 3b |; im2 = |pattern;|
|00000f30| 0a 72 6f 77 63 6f 6c 20 | 72 69 67 68 74 62 6f 74 |.rowcol |rightbot|
|00000f40| 74 6f 6d 28 69 6d 31 2e | 71 5f 6e 72 6f 77 73 28 |tom(im1.|q_nrows(|
|00000f50| 29 2d 31 2c 69 6d 31 2e | 71 5f 6e 63 6f 6c 73 28 |)-1,im1.|q_ncols(|
|00000f60| 29 2d 31 29 3b 0a 72 6f | 77 63 6f 6c 20 63 65 6e |)-1);.ro|wcol cen|
|00000f70| 74 65 72 28 69 6d 31 2e | 71 5f 6e 72 6f 77 73 28 |ter(im1.|q_nrows(|
|00000f80| 29 2f 32 2c 69 6d 31 2e | 71 5f 6e 63 6f 6c 73 28 |)/2,im1.|q_ncols(|
|00000f90| 29 2f 32 29 3b 0a 09 09 | 09 09 09 2f 2f 20 4d 6f |)/2);...|...// Mo|
|00000fa0| 64 69 66 79 69 6e 67 20 | 70 69 78 65 6c 73 20 6f |difying |pixels o|
|00000fb0| 6e 6c 79 20 77 69 74 68 | 69 6e 20 74 68 65 0a 09 |nly with|in the..|
|00000fc0| 09 09 09 09 2f 2f 20 6c | 6f 77 65 72 20 6c 65 66 |....// l|ower lef|
|00000fd0| 74 20 71 75 61 64 72 61 | 6e 74 0a 69 6d 31 2e 72 |t quadra|nt.im1.r|
|00000fe0| 65 63 74 61 6e 67 6c 65 | 28 63 65 6e 74 65 72 2c |ectangle|(center,|
|00000ff0| 72 69 67 68 74 62 6f 74 | 74 6f 6d 29 20 2d 3d 20 |rightbot|tom) -= |
|00001000| 32 2a 70 61 74 74 65 72 | 6e 3b 0a 61 73 73 65 72 |2*patter|n;.asser|
|00001010| 74 28 20 21 28 69 6d 31 | 20 3d 3d 20 32 2a 70 61 |t( !(im1| == 2*pa|
|00001020| 74 74 65 72 6e 29 20 26 | 26 20 21 28 69 6d 31 20 |ttern) &|& !(im1 |
|00001030| 21 3d 20 32 2a 70 61 74 | 74 65 72 6e 29 20 29 3b |!= 2*pat|tern) );|
|00001040| 0a 09 09 09 09 09 2f 2f | 20 41 6e 6f 74 68 65 72 |......//| Another|
|00001050| 20 77 61 79 20 6f 66 20 | 64 6f 69 6e 67 20 74 68 | way of |doing th|
|00001060| 69 73 0a 69 6d 31 2e 73 | 68 69 66 74 5f 63 6c 69 |is.im1.s|hift_cli|
|00001070| 70 5f 61 64 64 28 63 65 | 6e 74 65 72 2c 32 2c 69 |p_add(ce|nter,2,i|
|00001080| 6d 32 29 3b 20 20 61 73 | 73 65 72 74 28 69 6d 31 |m2); as|sert(im1|
|00001090| 20 3d 3d 20 32 2a 70 61 | 74 74 65 72 6e 29 3b 0a | == 2*pa|ttern);.|
|000010a0| 0a 2f 2f 20 4d 69 73 63 | 65 6c 6c 61 6e 65 61 0a |.// Misc|ellanea.|
|000010b0| 09 09 09 09 09 2f 2f 20 | 4e 6f 74 65 20 22 65 78 |.....// |Note "ex|
|000010c0| 70 61 6e 64 65 64 22 20 | 66 69 6c 65 20 6e 61 6d |panded" |file nam|
|000010d0| 65 20 6f 66 20 74 68 65 | 0a 09 09 09 09 09 2f 2f |e of the|......//|
|000010e0| 20 69 6d 61 67 65 0a 49 | 4d 41 47 45 20 72 61 77 | image.I|MAGE raw|
|000010f0| 5f 69 6d 61 67 65 28 22 | 7a 63 61 74 20 2e 2e 2f |_image("|zcat ../|
|00001100| 2e 2e 2f 70 69 63 74 75 | 72 65 73 2f 6c 65 6e 6e |../pictu|res/lenn|
|00001110| 61 2e 78 77 64 2e 5a 20 | 7c 22 29 3b 0a 2f 2f 20 |a.xwd.Z ||");.// |
|00001120| 20 49 4d 41 47 45 20 69 | 6d 61 67 65 28 49 4d 41 | IMAGE i|mage(IMA|
|00001130| 47 45 3a 3a 53 68 72 69 | 6e 6b 2c 72 61 77 5f 69 |GE::Shri|nk,raw_i|
|00001140| 6d 61 67 65 29 3b 0a 49 | 4d 41 47 45 20 69 6d 61 |mage);.I|MAGE ima|
|00001150| 67 65 20 3d 20 72 61 77 | 5f 69 6d 61 67 65 2e 73 |ge = raw|_image.s|
|00001160| 71 75 61 72 65 5f 6f 66 | 28 32 35 36 2c 72 6f 77 |quare_of|(256,row|
|00001170| 63 6f 6c 28 31 32 30 2c | 31 30 30 29 29 3b 0a 69 |col(120,|100));.i|
|00001180| 6d 61 67 65 2e 77 72 69 | 74 65 28 22 2f 74 6d 70 |mage.wri|te("/tmp|
|00001190| 2f 69 6f 72 22 2c 22 4f | 72 69 67 69 6e 61 6c 20 |/ior","O|riginal |
|000011a0| 69 6d 61 67 65 22 29 3b | 0a 69 6d 61 67 65 2e 64 |image");|.image.d|
|000011b0| 69 73 70 6c 61 79 28 22 | 49 6d 61 67 65 20 74 6f |isplay("|Image to|
|000011c0| 20 64 69 73 70 6c 61 79 | 22 29 3b 0a 0a 0a 0a | display|");.... |
+--------+-------------------------+-------------------------+--------+--------+